#pragma once
#include "Std.h"
#include "MouseEvent.h"
#include "KeyBoardEvent.h"

class UIControl
{
protected:
	bool		m_isEnable;
	bool		m_hasFocus;
	bool		m_isDefault;
	bool		m_bMouseOver;
	bool		m_isVisible;
	
	int			m_iWidth;
	int			m_iHeight;

	int			m_iID;
	UINT		m_uTabIndex;
	UINT		m_uHotKey;

	D3DXVECTOR3	m_v3Location;

	UIControl*	m_pParent;
	void*		m_pUserData;

public:
					UIControl(UIControl* p_pParent);
	virtual			~UIControl();

	virtual void		onFocus();
	virtual void		onLostFocus();
	virtual void		onMouseUp(MouseEvent* p_event) {};
	virtual void		onMouseDown(MouseEvent* p_event) {};
	virtual void		onMouseMove(MouseEvent* p_event) {};
	virtual void		onMouseEnter(MouseEvent* p_event) {};
	virtual void		onMouseOut(MouseEvent* p_event) {};

	virtual void		onKeyUp() {};
	virtual void		onKeyDown() {};	
	virtual void		onHotKey() {};

	virtual	void		draw() {};

	void*				getUserData();
	void				setUserData(void* p_pUserData);
	virtual void		setParent(UIControl* p_pParent);
	virtual UIControl*	getParent();	
	bool				isEnable();
	bool				isVisible();
	bool				isFocus();
	virtual	LPSTR		getType();

	void setPosition(int p_iX, int p_iY);
};

